home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / video / fly8111-.000 / fly8111- / fly8 / obroken.c < prev    next >
C/C++ Source or Header  |  1979-12-31  |  869b  |  55 lines

  1. /* --------------------------------- obroken.c ------------------------------ */
  2.  
  3. /* This is part of the flight simulator 'fly8'.
  4.  * Author: Eyal Lebedinsky (eyal@ise.canberra.edu.au).
  5. */
  6.  
  7. /* object: broken.
  8. */
  9.  
  10. #include "fly.h"
  11.  
  12.  
  13. static SHAPE shape_broken = {
  14.     0,
  15.     0,
  16.     SH_G,
  17.     10*1000L,    /* weight */
  18.     0        /* drag */
  19. };
  20.  
  21. LOCAL_FUNC int FAR
  22. create_broken (OBJECT *p)
  23. {
  24.     if (!st.owner)
  25.         return (1);
  26.  
  27.     p->color = CC_GREEN;
  28.     p->time = (Frand()%TIMEPSEC)*2 + TIMEPSEC;
  29.     p->flags |= F_VISIBLE;
  30.     p->owner   = st.owner;
  31.     p->ownerid = st.owner->id;
  32.     p->damage = 1;
  33.     p->damaging = 1;
  34.     if (st.owner->flags & F_IMPORTED) {
  35.         p->flags |= F_IMPORTED;
  36.         p->rplayer = st.owner->rplayer;
  37.     }
  38.     LVcopy (p->R, st.owner->R);
  39.     Mident (p->T);
  40.     return (0);
  41. }
  42.  
  43. BODY FAR BoBroken = {
  44.     0,
  45.     0,
  46.     "BROKEN",
  47.     &shape_broken,
  48.     gen_read,
  49.     gen_term,
  50.     create_broken,
  51.     gen_delete,
  52.     gen_dynamics,
  53.     gen_hit
  54. };
  55.